<?php

namespace App\Models\System;

use App\Models\Strator\Strator;
use App\Models\Traits\DateTimeTrait;
use App\Models\Traits\ModelSearchTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

class SystemOperationLog extends Model
{
    use SoftDeletes, DateTimeTrait, ModelSearchTrait;

    protected $dateFormat = 'Y-m-d H:i:s';
    protected $guarded = [];

    //
    public function searchConditions():array{
        return [
            ['strator_id','='],
            ['operation_type','like'],
            ['original_data','like'],
            ['param','like'],
            ['extra','='],
        ];
    }

    public function strator():BelongsTo{
        return $this->belongsTo(Strator::class,'strator_id','id');
    }

}
